<?php
//
namespace app\home\controller;

use app\common\model\SpecialModel;
use think\Request;

class IndexController extends BaseController
{

    public function __construct(Request $request)
    {
        parent::__construct($request);
    }

    /*
     * 网站首页
     */
    public function index()
    {
        return $this->fetch();
    }
    /*
     * 网站首页套的数据
     */
    public function indexo()
    {
        $a = get_jicai_list([],4);
        //dump($a[0]);
        return $this->fetch();
    }

    /*
     * 专题页
     */
    public function special()
    {
        $specialId    = $this->request->param('special_id/d');
        $specialModel = new SpecialModel();
        $specialInfo  = $specialModel->find($specialId);
        if ($specialInfo && $specialInfo['special_status'] == 1) {
            $this->assign('keyword',$specialInfo['special_keyword']);
            $this->assign('description',$specialInfo['special_description']);
            $this->assign('specialInfo', $specialInfo);
            return $this->display($specialInfo['special_content']);
        } else {
            $this->error('请先发布该专题！');
        }
    }
    /*以下方法仅为演示静态页面，套取数据时请迁移*/
    /*商品频道页*/
    public function goodsChannel(){
        return $this->fetch();
    }
    /*限时抢购*/
    public function goodsLimit(){
        return $this->fetch();
    }
    /*集采频道页*/
    public function groupBuy(){
        return $this->fetch();
    }
    /*资讯频道页*/
    public function newsChannel(){
        return $this->fetch();
    }
    /*资讯list页*/
    public function newsList(){
        return $this->fetch();
    }
    /*商品列表页*/
    public function goodsList(){
        return $this->fetch();
    }
    /*商品内容页*/
    public function goods(){
        return $this->fetch();
    }
    /*供应商入驻*/
    public function supplier(){
        return $this->fetch();
    }
    /*购物车*/
    public function cart(){
        return $this->fetch();
    }
    /*订单确认*/
    public function orderConfirm(){
        return $this->fetch();
    }
    /*订单支付*/
    public function orderPay(){
        return $this->fetch();
    }
}
